/**
 * 
 */
package labs;

/**
 * @author Nate Waldrop
 * CS 3230
 * Lab 3
 *
 */
//import java.io.*;
import java.util.*;

public class Lab3 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		//Need a scanner
		Scanner in = new Scanner(System.in);
		int treeHeight;
				
		//Prompt for height
		System.out.print("Insert the height of the desired tree from 3 to 15: ");
		treeHeight = in.nextInt();
		//Validate height
		if (treeHeight > 15 || treeHeight < 3){
			System.out.println("Tree height is outside of bounds - exiting...");
			return;
		}
		
		//Generate tree top
		for(int i = treeHeight; i > 0; i--){
			for(int j = 0; j < i; j++)
			{
				System.out.print(" ");
			}
			System.out.print("/");
			
			for(int k = (treeHeight - i)*2; k > 0; k--){
				System.out.print(" ");
			}
			System.out.println("\\");
		}
		
		//generate tree bottom
		System.out.print(" ");
		for(int l = 0; l < treeHeight * 2; l++){
			System.out.print("-");
		}
		
		System.out.println("");
		//generate trunk
		int trunkHeight = treeHeight / 2;
		for(int i = trunkHeight; i > 0; i--){
			for(int j = treeHeight; j > 0; j--){
				System.out.print(" ");
			}
			System.out.println("||");
		}
	}

}
